﻿var admin = "";
var logout_url = "";
var login_url = "";

function init(admin_state, name, logout, login) {
    admin = admin_state;
    admin_name = name;
    logout_url = logout;
    login_url = login;
}

function update() {
    if (admin == "Yes") {
        $("#welcome").text(admin_name);
        document.getElementById("login").href = logout_url;
        $("#login").text("Logout");
        document.getElementById("create").href = '#add_queue';
        document.getElementById("create_m").href = '#add_queue';
    }
    else {
		document.getElementById("welcome").innerHTML='Guest';
        var login = document.getElementById("login");
        document.getElementById("login").href = login_url;
        $("#login").text("Login");
        document.getElementById("create").href = login_url;
        document.getElementById("create_m").href = login_url;
    }
}